import Vue from "vue";
import VueRouter from "vue-router";
import AddGoods from "@/pages/AddGoods.vue";
import GoodsList from "@/pages/GoodsList.vue";
import MyCart from "@/pages/MyCart.vue";
import Login from "@/pages/Login.vue";
import Home from "@/pages/Home.vue";
Vue.use(VueRouter);
const router = new VueRouter({
    mode:'history',
    routes:[
        {
            path:'/login',
            component:Login
        },
        {
            path:'/',
            component:Home,
            children:[
                {
                    path:'/addgoods',
                    component:AddGoods
                },
                {
                    path:"/goodslist",
                    component:GoodsList
                },
                {
                    path:'/mycart',
                    component:MyCart,
                },
                {
                    path:'/',
                    redirect:'/addgoods'
                }
            ]
        }
    ]
});
export default router;